<template>
	<view>
		   <u-navbar
            :title="chatObjectInfo.account"   
            :autoBack="true"
        >
		
		<view slot="right" @click="toUserDetail">
			<u-icon name="more-circle"   size="26"></u-icon>
		</view>
        </u-navbar>
	</view>
</template>

<script>
	export default {
		name:"chatNavBar",
		props:{
			
		},
		data() {
			return {
				chatObjectInfo:null
			};
		},
		beforeMount() {
				this.chatObjectInfo=this.$store.state.chat.chatObjectInfo.chatObjectData	
		},
		methods:{
			toUserDetail(){//跳转到用户详情，如果是个人聊天就跳转到 该聊天对象的详情页面 如果是群就跳转到该聊天群的详情页
				console.log(this.chatObjectInfo.accept_type)
				if(this.chatObjectInfo.accept_type==1){
					uni.navigateTo({
						url:'/pages/userDetail/userDetail'
					})
				}
				if(this.chatObjectInfo.accept_type==2){
					uni.navigateTo({
						url:'/pages/groupDetail/groupDetail'
					})
				}
			}
		}
	}
</script>

<style lang="scss">

</style>
